package com.zhilianbao.leyaogo.ui.adapter.home;

import android.content.Context;

import com.bql.baseadapter.recycleView.QuickRcvAdapter;
import com.bql.baseadapter.recycleView.QuickRcvHolder;
import com.zhilianbao.leyaogo.R;
import com.zhilianbao.leyaogo.model.response.home.SupplierInfo;
import com.zhilianbao.leyaogo.utils.Utils;

import java.util.List;

/**
 * ClassName: SelectAddressAdapter <br>
 * Description: 选择地址适配器<br>
 * Author: Cyarie <br>
 * Created: 2016/11/1 17:36 <br>
 * Update Time：<br>
 * Update Description：<br>
 */
public class SwitchClientAdapter extends QuickRcvAdapter<SupplierInfo> {

    public SwitchClientAdapter(Context context, List<SupplierInfo> data) {
        super(context, data, R.layout.item_select_address);
    }

    @Override
    protected void bindDataHelper(QuickRcvHolder viewHolder, int position, SupplierInfo item) {
        viewHolder.setText(R.id.tv_shop, item.getSupplierName());
        if (Utils.getSupplierId() == item.getSupplierId()) {
            viewHolder.setVisible(R.id.iv_tick, true);
        } else {
            viewHolder.setVisible(R.id.iv_tick, false);
        }
    }
}
